From 42bedc9968b7c5576b581bfd0e5d44704295b067 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 10 Oct 2002 16:08:13 +0000 Subject: [PATCH] Fix crash in garmin when uploading waypoints w/o description set. --- gpsbabel/garmin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gpsbabel/garmin.c b/gpsbabel/garmin.c index c85195b57..b1df22a37 100644 --- a/gpsbabel/garmin.c +++ b/gpsbabel/garmin.c @@ -105,7 +105,12 @@ data_write(void) wpt->shortname; strncpy(way[i]->ident, ident, sizeof(way[i]->ident)); - strncpy(way[i]->cmnt, wpt->description, sizeof(way[i]->cmnt)); + if (wpt->description) { + strncpy(way[i]->cmnt, wpt->description, + sizeof(way[i]->cmnt)); + } else { + way[i]->cmnt[0] = 0; + } way[i]->lon = wpt->position.longitude.degrees; way[i]->lat = wpt->position.latitude.degrees; way[i]->alt = wpt->position.altitude.altitude_meters; -- 2.30.2